Key And Locking Functions